package com.caigou.comm.base.ext

import android.webkit.JavascriptInterface
import androidx.annotation.Keep

/**
 * @author #Suyghur.
 * Created on 2021/12/29
 */
@Keep
class HybridImpl(private val callback: IJsCallback) {

    @JavascriptInterface
    fun getUserId(): String {
        return callback.onCallback("getUserId", "")
    }

    @JavascriptInterface
    fun back() {
        callback.onCallback("back", "")
    }
}

interface IJsCallback {
    fun onCallback(method: String, data: String): String
}
